package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AccessoryManagementMapper;
import com.ruoyi.system.domain.AccessoryManagement;
import com.ruoyi.system.service.IAccessoryManagementService;

/**
 * 配品管理 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-24
 */
@Service
public class AccessoryManagementServiceImpl implements IAccessoryManagementService
{
    @Autowired
    private AccessoryManagementMapper accessoryManagementMapper;

    /**
     * 通过id查询配品管理
     *
     * @param id 配品管理主键
     * @return 配品原材料管理
     */
    @Override
    public AccessoryManagement selectAccessoryManagementById(Long id)
    {
        return accessoryManagementMapper.selectAccessoryManagementById(id);
    }

    /**
     * 通过条件查询配品管理列表
     *
     * @param accessoryName,barcode 配品名称，条码
     * @return 配品管理
     */
    @Override
    public List<AccessoryManagement> selectAccessoryManagementListByConditions(String accessoryName,String barcode)
    {
        return accessoryManagementMapper.selectAccessoryManagementListByConditions(accessoryName,barcode);
    }

    /**
     * 新增配品管理
     *
     * @param accessoryManagement 配品管理
     * @return 结果
     */
    @Override
    public int insertAccessoryManagement(AccessoryManagement accessoryManagement)
    {
        return accessoryManagementMapper.insertAccessoryManagement(accessoryManagement);
    }

    /**
     * 修改配品管理
     *
     * @param accessoryManagement 配品管理
     * @return 结果
     */
    @Override
    public int updateAccessoryManagement(AccessoryManagement accessoryManagement)
    {
        return accessoryManagementMapper.updateAccessoryManagement(accessoryManagement);
    }

    /**
     * 通过id批量删除配品管理信息
     *
     * @param ids 需要删除的配品管理主键
     * @return 结果
     */
    @Override
    public int deleteAccessoryManagementByIds(Long[] ids)
    {
        return accessoryManagementMapper.deleteAccessoryManagementByIds(ids);
    }

    /**
     * 通过id删除配品管理信息
     *
     * @param id 配品管理主键
     * @return 结果
     */
    @Override
    public int deleteAccessoryManagementById(Long id)
    {
        return accessoryManagementMapper.deleteAccessoryManagementById(id);
    }
}
